package string;

public class StartsWithDemo {
    public static void main(String[] args) {
        String str = "thinking in java";
        boolean starts = str.startsWith("think");//判断str是否以think开头的
        System.out.println(starts);//true
        boolean ends = str.endsWith(".png");//判断str是否以.png结尾的
        System.out.println(ends);
    }
}
